<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="text"><button>提交</button>
    <script>
        var btnEle = document.querySelector('button');
        var inputEle = document.querySelector("input");
        btnEle.onclick = function (){
            console.log(inputEle.value);
        }
        document.onkeydown = function ( event ){
            var e = event || window.event ; 
            if ( parseInt(e.keyCode) >= 96 && parseInt(e.keyCode) <= 106 ){
                // btnEle.click();
                console.log(e.keyCode - 96);
            }
        }
    </script>
</body>
</html>